// 错误边界组件样式
// 用于显示友好的错误页面，替代应用崩溃
// 错误边界容器
.error-boundary {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

// 错误内容容器
.error-container {
    text-align: center;
    max-width: 500px;
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

// 错误图标
.error-icon {
    margin-bottom: 1.5rem;
    .el-icon {
        font-size: 4rem;
        color: #f59e0b;
        animation: pulse 2s infinite;
    }
}

// 错误标题
.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    margin-top: 0;
}

// 错误描述
.error-description {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    margin-top: 0;
}

// 错误详情区域
.error-details {
    margin-bottom: 2rem;
    text-align: left;
    details {
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        padding: 1rem;
        background: #f9fafb;
        summary {
            cursor: pointer;
            font-weight: 500;
            color: #374151;
            margin-bottom: 0.5rem;
            &:hover {
                color: #1f2937;
            }
        }
    }
    .error-stack {
        background: #1f2937;
        color: #f3f4f6;
        padding: 1rem;
        border-radius: 4px;
        font-size: 0.875rem;
        line-height: 1.5;
        overflow-x: auto;
        white-space: pre-wrap;
        margin: 0;
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    }
}

// 操作按钮区域
.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    .el-button {
        min-width: 120px;
        height: 40px;
        .el-icon {
            margin-right: 0.5rem;
        }
    }
    .retry-btn {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        border: none;
        &:hover {
            background: linear-gradient(135deg, #5855eb 0%, #7c3aed 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
    }
    .home-btn {
        border: 1px solid #d1d5db;
        color: #374151;
        &:hover {
            border-color: #9ca3af;
            color: #1f2937;
            background: #f9fafb;
        }
    }
}

// 脉冲动画
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

// 响应式设计
@media (max-width: 768px) {
    .error-boundary {
        padding: 1rem;
        min-height: 50vh;
    }
    .error-container {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    .error-icon .el-icon {
        font-size: 3rem;
    }
    .error-title {
        font-size: 1.25rem;
    }
    .error-actions {
        flex-direction: column;
        align-items: center;
        .el-button {
            width: 100%;
            max-width: 200px;
        }
    }
}

@media (max-width: 480px) {
    .error-container {
        padding: 1.5rem 1rem;
    }
    .error-icon .el-icon {
        font-size: 2.5rem;
    }
    .error-title {
        font-size: 1.125rem;
    }
    .error-description {
        font-size: 0.875rem;
    }
}